import request from '@/utils/request'

export function login(data) {
  /**
 *  用户登录接口
 *
 * **/
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

/**
 *  获取用户的基本资料
 *
 * **/
export function getUserInfo() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}
export function getEmployeeInfo(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'GET'
  })
}

// 做插件兼容处理
export const getUserDetailById = getEmployeeInfo

export function updateEmployeeInfo(data) {
  return request({
    url: '/sys/user/' + data.id,
    method: 'PUT',
    data
  })
}

export function delEmployee(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
